<template>
  <div><h1>123</h1></div>
</template>

<script>
const axios = require('axios')
export default {
  name: 'user',
  data () {
    return {
      user: 'yangjie'
    }
  },
  methods: {
    doLogin () {
      alert(this.user)
      axios.post('http://localhost:8080/sysUser/userAll', {
        user: this.user
      }).then((response) => {
        alert(response.data)
        if (response.data.code === 'true') {
          this.$router.push({ name: 'user' })
        }
      })
    }
  },
  mounted () {
    alert(1)
    axios.post('http://localhost:8080/sysUser/userAll').then((response) => {
      alert(JSON.stringify(response.data))
      alert(JSON.parse(response.data))
    })
  }
}
</script>

<style scoped>

</style>
